package org.wu.spring.db.integration.compare;

import org.wu.framework.core.utils.FileUtil;

import java.io.BufferedWriter;
import java.io.IOException;

public class GenerateFieldForDb {
    public static void main(String[] args) throws IOException {
        /**
         * 创建do对象增加40个字段
         */
        BufferedWriter fileBufferedWriter = FileUtil.createFileBufferedWriter( FileUtil.createUserDirFile("db.java"));
        for (int i = 1; i <= 40000; i++) {
            String format = String.format("/**\n" +
                            "     * 额外字段%s\n" +
                            "     */\n" +
                             "    private String columnName_%s;",
                    i, i, i, i, i, i

            );
            fileBufferedWriter.write(format);
            fileBufferedWriter.newLine();
            System.out.println(format);
        }

        fileBufferedWriter.close();
        /**
         * 创建dto对象增加40个字段
         */
//        for (int i = 1; i <=40; i++) {
//            System.out.println(String.format("  /**\n" +
//                    "     * \n" +
//                    "     * 额外字段%s\n" +
//                    "     */\n" +
//                    "    @Schema(description =\"额外字段%s\",name =\"columnName%s\",example = \"\")\n" +
//                    "    private String columnName_%s;",
//                    i,i,i,i
//                    ));
//        }

        /**
         * sql 增加40个字段
         */
//        for (int i = 1; i <= 40; i++) {
////            System.out.printf("`column_name_%s`,", i);
//            System.out.printf("#{item.columnName_%s},", i);
//        }
//        System.out.println();
//        for (int i = 1; i <= 40; i++) {
//            System.out.printf(String.format("column_name_%s,",i));
//        }
    }
}
